package lab04.test01;

public class HelloWorldThread extends Thread {
    /*实现线程方法
    extends Thread
    inplements Runnable
     */
    @Override
    public void run() {
        //每隔1秒向控制台输出"Hello,World!"
        while (true) {
            try {
                //1秒=1000毫秒
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            System.out.println("Hello,world!");
        }
    }
}